package com.wceManage.services.impl;

import java.util.HashMap;

import com.wceManage.services.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.wceManage.beans.SysUser;
import com.wceManage.data.mapper.BaseMapper;
import com.wceManage.data.mapper.SysUserMapper;

/**
 * FootballSysUserServiceImpl 系统用户
 */
@Service
public class SysUserServiceImpl extends BaseServiceImpl<SysUser> implements SysUserService {

	@Autowired
	private SysUserMapper sysUserMapper;

	@Override
	public BaseMapper<SysUser> getMapper() {
		return sysUserMapper;
	}

	/**
	 * 根据用户账号查询
	 * 
	 * @param account
	 * @return
	 */
	public SysUser queryUserByAccount(String account) {
		return sysUserMapper.queryUserByAccount(account);
	}

	/**
	 * 根据用户账户修改用户密码
	 * 
	 * @param param
	 * @return
	 */
	public int updateUserPwd(HashMap<String, String> param) {
		return sysUserMapper.updateUserPwd(param);
	}

	/**
	 * 删除用户角色关联数据
	 * 
	 * @param sysUser
	 * @return
	 */
	public int deleteUserRole(SysUser sysUser) {
		return sysUserMapper.deleteUserRole(sysUser);
	}

	/**
	 * 插入用户角色关联数据
	 * 
	 * @param sysUser
	 * @return
	 */
	public int insertUserRole(SysUser sysUser) {
		return sysUserMapper.insertUserRole(sysUser);
	}

	@Override
	public SysUser queryDetail(Long id) {
		return sysUserMapper.queryDetail(id);
	}

	@Override
	//@Transactional(isolation = Isolation.READ_UNCOMMITTED)
	public SysUser queryUser(SysUser sysUser) {
		return sysUserMapper.queryUser(sysUser);
	}

	@Override
	public int deleteByPrimaryKey(Long userId) {
		// TODO Auto-generated method stub
		return sysUserMapper.deleteByPrimaryKey(userId);
	}
}
